#include "Book.h"
#include <iomanip>
#include <iostream>
#include "Person.h"
using namespace std;

Book::Book(string &name, Person *author) : name(name), author(author){

}

Book::Book(const Book &b){
	this->author = b.author;
	this->name = b.name;
}

Book::~Book(){
	delete author;
}

Book& Book::operator =(const Book &b){
	if(this != &b){
		this->author = b.author;
		this->name = b.name;
	}
	return *this;
}
const Person* Book::getAuthor() const{
	return this->author;
}

const string& Book::getName() const{
	return this->name;
}

ostream& operator<<(ostream& os, const Book& book){
	os << "Title: " << book.getName() << 	" Author: " << *(book.getAuthor()) << endl;
	return os;
}